import request from '@/utils/request'

//获取公海池数据的page list
export function getFContactInfoList(params) {
  return request({
    url: '/AttractInvestment/customer/highSeasList',
    method: 'get',
    params
  })
}


//获取客户列表的page list
export function getCustomerListPage(data) {
  return request({
    url: '/AttractInvestment/customer/customerListPage',
    method: 'post',
    data: data
  })
}

// 查询部门
export function getDepartmentList(params) {
  return request({
    url: '/AttractInvestment/follow/departmentList',
    method: 'get'
  })
}

/**
 * 根据客户编号查询客户信息
 * @returns {*}
 */
export function selectCustomerListByCustomerId(customerId){
  return request({
    url: `/AttractInvestment/customer/selectCustomerListByCustomerId/${customerId}`,
    method: 'get'

  })
}

/**
 * 根据companyId获取客户联系人
 * @param data
 * @returns {*}
 */
export function getCustomerContact(customerId) {
  return request({
    url: `/AttractInvestment/customer/contacetGetOneById/${customerId}`,
    method: 'get',
  })
}

/**
 * 新增客户联系人
 * @param data
 * @returns {*}
 */
export function contacetInsert(data) {
  return request({
    url: `/AttractInvestment/customer/contacetInsert`,
    method: 'post',
    data
  })
}


/**
 * 根据客户id修改客户信息
 * @param data
 * @returns {*}
 */
export function updateCustomerInfo(data) {
  return request({
    url: '/AttractInvestment/customer/updateByCustomerId',
    method: 'post',
    data
  })
}

/**
 * 新增客户
 * @param data
 * @returns {*}
 */
export function addCustomerInfo(data) {
  return request({
    url: '/AttractInvestment/customer/addCustomer',
    method: 'post',
    data
  })
}

/**
 * 修改客户联系人
 * @param data
 * @returns {*}
 */
export function updateContacetInfo(data) {
  return request({
    url: '/AttractInvestment/customer/contacetUpdate',
    method: 'put',
    data
  })
}

/**
 * 删除客户联系人
 * @param id
 * @returns {*}
 */
export function delCustomerContact(id) {
  return request({
    url: `/AttractInvestment/customer/contacetDel/${id}`,
    method: 'delete',
  })
}
/**
 * 放弃归入公海池
 * @param customerId
 * @returns {*}
 */
export function updateScoreA(data) {
  return request({
    url: '/AttractInvestment/customer/updateScoreA',
    method: 'post',
    data
  })
}

/**
 * 获取客户需求列表
 * @param data
 * @returns {*}
 */
export function getCustomerRequirementList(data) {
  return request({
    url: '/AttractInvestment/customer_requirement/list',
    method: 'get',
    data
  })
}

/**
 * 根据id获取客户需求
 * @param customerId
 * @returns {*}
 */
export function getCustomerRequirementBycustomerId(customerId) {
  return request({
    url: `/AttractInvestment/customer_requirement/getListById/${customerId}`,
    method: 'get',
  })
}

/**
 * 客户需求新增
 * @param data
 * @returns {*}
 */
export function addCustomerRequirement(data) {
  return request({
    url: '/AttractInvestment/customer_requirement/insert',
    method: 'post',
    data
  })
}

/**
 * 客户需求修改
 * @param data
 * @returns {*}
 */
export function updateCustomerRequirement(data) {
  return request({
    url: '/AttractInvestment/customer_requirement/update',
    method: 'put',
    data
  })
}

// 示例：公海池-捞取
export const rescue = (data) => {
  return request({
    url: '/AttractInvestment/customer/highSeas/rescue',
    method: 'put',
    params: data
  });
};

/**
 * 新增企业
 * @param data
 * @returns {*}
 */
export function insertCompanyTotal(data) {
  return request({
    url: '/AttractInvestment/company_total/insert',
    method: 'post',
    data
  })
}

export function getBusinessDevelopers(params) {
  return request({
    url: '/AttractInvestment/customer/businessDevelopers',
    method: 'get',
    params
  })
}

/**
 * 重新分配跟进人员
 * @param data
 * @returns {*}
 */
export function updateBusinessDeveloperByCustomerId(data) {
  return request({
    url: '/AttractInvestment/customer/updateBusinessDeveloperByCustomerId',
    method: 'post',
    data
  })
}